#include #include using namespace std; // pass by value mechanism void addTwo(int); // pass by value mechanism with return int addTwoRet(int); // pass by reference void addTwoRef(int &); void main(){ double d = sqrt(9.0); cout << d << endl; int k = 2; addTwo(k); cout << k << endl; k = addTwoRet(k); cout << k << endl; // declare m which is the same as k // but with a different name int &m = k; cout << m << endl; int q = 7; addTwoRef(q); cout << q << endl; } void addTwo(int z){ // z is a copy of k z+=2; } int addTwoRet(int z){ z+=2; return z; } void addTwoRef(int &p){ p+=2; }